import request from '@/utils/request'



/**
 * 产品类型
 * @return  [
{
"name": "Chip Analog", //类型名称
"id": "24" //类型编号
}
]
 */
export function getLockType(data?:any): Promise<any> {
  return request.get('lock/lockType', {params:data})
}

/**
 * 产品列表
 * @return [
{
"price": "120000",
"dayIncomeLow": "0.034", //每24小时最低收益率
"name": "ADC MCP3008", //名称
"logo": "https://img.EstelarOlas.net/content/uploadimg/A20250404103012.jpg", //图片
"id": "1", //产品编号
"cycle": "50", //周期（天）
"dayIncomeHigh": "0.036" //每24小时最收益率
}
] 
 */


export function getLockMallList(data?:{id:string}): Promise<any> {
    return request.get('lock/lockMallList', {params:data})
  }

/**
 * 产品详情
 * @return  {
            "limitnum": "1", //限购
            "price": "120000", //价格
            "dayIncomeLow": "0.034", //每24小时最低收益率
            "name": "ADC MCP3008", //名称
            "logo": "https://img.EstelarOlas.net/content/uploadimg/A20250404103012.jpg", //图片
            "id": "1", //产品编号
            "lever": "1", //VIP购买
            "cycle": "50", //周期（天）
            "dayIncomeHigh": "0.036", //每24小时最收益率
            "info": "--" //合同
        }
 */
export function getLockMallInfo(data?:{id:string}): Promise<any> {
    return request.get('lock/getLockMallInfo', {params:data})
}
// 认购产品
//"id": "1", //产品编号
//"wallet": "1" //钱包类型（1：存款钱包  2：收入钱包）
  export function addLockOrder(data?:{id:string, wallet:string}): Promise<any> {
    return request.post('lock/addLockOrder', data)
  }


  /**
 * 订单记录
 * @param type  0运行中 1已结束
 * @return   [
    {
    "nextProfitTime": "86392", //下次领取收益
    "creatTime": "16:21 06/05", //购买时间
    "receivestate": "1", //0无收益  1待领取
    "onCycle": "0", //运行
    "price": "120000", //价格
    "dayIncomeLow": "0.034", //每24小时最低收益率
    "name": "ADC MCP3008", //名称
    "logo": "https://img.EstelarOlas.net/content/uploadimg/A20250404103012.jpg", //图片
    "id": "1", //订单编号
    "endTime": "16:21 25/06", //到期时间
    "cycle": "50", //周期（天）
    "dayIncomeHigh": "0.036" //每24小时最收益率
    }
]
 */
export function lockMallOrder(data?:{type:string, page:string, limit: string}): Promise<any> {
    return request.get('lock/lockMallOrder', {params:data})
  }
 /**
 * 领取收益
 * @param id  
 */
export function receiveLockOrderIncome(data?:{id:string}): Promise<any> {
  return request.post('lock/receiveLockOrderIncome', data)
}

/**
 * 订单收益明细
 * @return [
{
"number": "4122", //收益数量
"writedate": "12:29 12/05/2025", //领取
"source": "--"
}
]
 */
export function lockMallOrderIncome(data?:{id:string, page:string, limit:string}): Promise<any> {
  return request.get('lock/lockMallOrderIncome', {params:data})
}